package Day07.Work7;

public class MyRectangle {
    /*    【编号：707】 请定义一个描述矩形（MyRectangle）的类，包含宽和高两个属性，
        提供获取矩形周长（perimeter）和面积（area）的方法。并编写测试类进行测试。*/
    private double High;
    private double Long;

    public double getHigh() {
        return High;
    }

    public void setHigh(double high) {
        High = high;
    }

    public double getLong() {
        return Long;
    }

    public void setLong(double aLong) {
        Long = aLong;
    }

    public MyRectangle(double High, double Long) {

        this.High = High;
        this.Long = Long;
    }

    public MyRectangle() {

    }

    public double perimeter() {

        return 2 * (this.High + this.Long);
    }

    public double area() {
        return this.High * this.Long / 2;
    }
}

class Test {
    public static void main(String[] args) {
        MyRectangle m = new MyRectangle(500, 600);
        System.out.println(m.area());
        System.out.println(m.perimeter());
    }

}
